<?php
session_start();
require_once '../header.php';
function __autoload($className)
	{
    	require_once('../class/' . $className . '.class.php');
	}
session::need_manage();
if(!empty($_POST))
{
	$submit=$_POST["submit"];
	if($submit=='submit')
	{
		$headers = 'From: cs@freshcvv.cc' . "\r\n" .
		'Reply-To: cs@freshcvv.cc' . "\r\n" .
		$title=$_POST["title"];
		$noidung=$_POST["soure"];
		$GetEmail=database::LimitQuery('userinfo',array(
'select' => 'email'
));
		$email=null;
		foreach($GetEmail as $ShowEmail)
		{
			$Mail=$ShowEmail['email'];
			if(stristr($Mail,"@")==true)
			{
				
				$a=mail($Mail,$title,$noidung,$headers);
			}
			
		}

	}

		
	
}
	else
	{
		$webroot="../";
		require_once '../html/admintemplate.php';
		?>
		
		<form name="sendemail" action="" method="POST" />
		<center><font color='red' > Title </font>
			<input name="title" type="text" /><br/>
		<textarea name="soure" rows="20" cols="60"></textarea><br/>
		<input name="submit" type="submit" value="submit" />
</center>
</form>
		<?php
	}


?>